﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Validator.Constraints;

namespace Landscape.Business.Entities
{
    public class UserIdentity
    {
        public UserIdentity()
        {
            //this.ID = -1;
            this.ID = Guid.Empty;
        }

        public virtual Guid ID
        { get; set; }

        [NotNull]
        [Length(Max=50, Message="Login name should not be more than 50 charectors.", Min=3)]
        [Pattern(Regex=@"^[A-Za-z0-9][^\s]*$", Message="Login name should not contain spaces.")]
        public virtual string LoginName
        { get; set; }

        [Length(Max = 50, Message = "Password should not be more than 50 charectors.", Min = 3)]
        public virtual string Password
        { get; set; }

        public virtual bool IsAdUser
        { get; set; }

        public virtual DateTime? LastLoginTime
        { get; set; }

        public virtual string IpAddress
        { get; set; }
    }
}
